const query = require('../util/sql')
module.exports = async (ctx, next) => {
	let workgroupid = ctx.request.query.workgroupid
	let sql = `select workgroup.id as groupid, workgroup.name, person.name as chairmanname, company as chairmanCompany, chairmanWorkingrule from workgroup left join person on workgroup.chairmanid = person.id where workgroup.id = ${workgroupid}`
	let data = await query(sql)
	console.log(data)
	ctx.state.data = data	
}